package com.tiecode.rhelper;

import com.qiplat.api.framework.project.base.ProjectLifecycleEvent;
import com.qiplat.api.project.Project;
import com.qiplat.api.project.ProjectManager;
import com.qiplat.api.project.TaskedProject;
import com.qiplat.api.project.task.Task;

public class RHelperProjectEvent implements ProjectLifecycleEvent {
    @Override
    public void onOpenProject(Project project, ProjectManager manager) {

    }

    @Override
    public void onOpenProjectFinish(Project project, ProjectManager manager) {
        if (!"cn.tiecode.android".equals(manager.getIdentifier())) {
            return;
        }
        TaskedProject taskedProject = (TaskedProject) project;
        ModifyJavaFileTask modifyJavaFileTask = new ModifyJavaFileTask();
        Task compileWithJavac = taskedProject.getTask("compileWithJavac");
        compileWithJavac.dependsOn(modifyJavaFileTask);
        taskedProject.addTask(modifyJavaFileTask);
    }

    @Override
    public void onCloseProject(Project project, ProjectManager manager) {

    }
}
